import React, {  useMemo } from 'react';
import './style.less';
import ProList from "@/component/layout/ProList/ProList";
import Medical from "@/component/layout/Medical/Medical";
import { getProductList, getMedicalList } from '@/network/protocol';
import CommonList from '@/component/common/CommonList/CommonList';


const List = ({ tabType, param,update }) => {


  const method = useMemo(() => {
    return [getProductList, getMedicalList][tabType]
  }, [tabType])

  const viewCmp = useMemo(() => {
    return [ProList, Medical][tabType]
  }, [tabType])


  return <div className="ProductInfo-List">
    <CommonList update={update} viewCmp={viewCmp} param={param} method={method} />
  </div>
}


export default React.memo(List)